
<div class="panel panel-default">
	<div class="panel-heading">活动信息
	<!--<a target="_blank" style="cursor:pointer; float:right; font-weight:bold;" href="http://v.youku.com/v_show/id_XMTc0OTkwNTU4NA==.html?from=s1.8-1-1.2&spm=a2h0k.8191407.0.0">视频演示>></a>-->
	<!--<a target="_blank" style="cursor:pointer; float:right; margin-right:10px; font-weight:bold;" href="http://doc.lexiangpingou.cn/releaseProduct.html#jbxx">图文说明>></a>-->
	</div>
	<div class="panel-body">
		<div class="panel-body">
		<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">排序</label>
				<div class="col-md-6">
					<input type="text" name="goods[displayorder]" class="form-control" value="{$goods['displayorder']}" />
				</div>
			</div>
			<div class="form-group">
				<!--<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span>所属商家</label>-->
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">预约日期</label>
				<div class="col-sm-4">
					{if empty($goods['apply_start'])}{php $goods['apply_start'] = time();}{/if}
					{if empty($goods['apply_end'])}{php $goods['apply_end'] = time();}{/if}
					{php echo tpl_form_field_daterange('apply_time', array('starttime'=>date('Y-m-d H:i', $goods['apply_start']),'endtime'=>date('Y-m-d H:i', $goods['apply_end'])),true);}
				</div>
			</div>
			<div class="form-group">
				<!--<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span>所属商家</label>-->
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">活动日期</label>
				<div class="col-sm-4">
					<script type="text/javascript">
                        require(["daterangepicker"], function($){
                            $(function(){
                                $(".daterange.daterange-date").each(function(){
                                    var elm = this;
                                    $(this).daterangepicker({
                                        startDate: $(elm).prev().prev().val(),
                                        endDate: $(elm).prev().val(),
                                        format: "YYYY-MM-DD"
                                    }, function(start, end){
                                        $(elm).find(".date-title").html(start.toDateStr() + " 至 " + end.toDateStr());
                                        $(elm).prev().prev().val(start.toDateStr());
                                        $(elm).prev().val(end.toDateStr());
                                    });
                                });
                            });
                        });
					</script>
					<input name="start_time" type="hidden" value="{if empty($start_time)}{php echo date('Y-m-d')}{else}{php echo $start_time}{/if}">
					<input name="end_time" type="hidden" value="{if empty($end_time)}{php echo date('Y-m-d')}{else}{php echo $end_time}{/if}">
					<button class="btn btn-default daterange daterange-date" type="button"><span class="date-title">
                        {if empty($start_time)}{php echo date("Y-m-d")}
                            {else}
                        {php echo $start_time}
                            {/if}
                        至
                        {if empty($end_time)}{php echo date("Y-m-d")}{else}{php echo $end_time}{/if}
                    </span> <i class="fa fa-calendar"></i></button>
				</div>
			</div>
			<div class="form-group" style="display:none;">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span>所属商家</label>
				<div class="col-md-6">
					<select name="goods[merchantid]" class="form-control">
						<option value="" {if empty($goods['merchantid'])}selected="selected"{/if}>{$_W['account']['name']}</option>
					{loop $merchants $row}
			            <option value="{$row['id']}" {if $goods['merchantid']==$row['id']}selected="selected"{/if}>{$row['name']}</option>
					{/loop}}
			        </select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span>项目分类</label>
				<div class="col-sm-6 col-xs-12">
					<select name="goods[fk_typeid]" class="form-control">
						{loop $category $row}
						<option value="{$row['id']}" {if $goods['fk_typeid'] == $row['id']}selected="selected"{/if}>{$row['name']}</option>
						{/loop}
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label"><span style='color:red'>*</span>活动名称</label>
				<div class="col-md-6">
					<input type="text" placeholder="为保证支付正常，商品名称字数不能大于30个字" name="goods[gname]" class="form-control" value="{$goods['gname']}" />
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">报名须知协议:</label>
				<div class="col-sm-9 col-xs-12" style="position:relative">
					{php echo tpl_ueditor('goods[notice]', $goods['notice']);}
				</div>
			</div>
			<div class="form-group" style="display: none">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">单位</label>
				<div class="col-md-6">
					<input type="text" name="goods[unit]" class="form-control" value="{$goods['unit']}" />
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">库存</label>
				<div class="col-md-6">
					<div class="input-group">
						<input type="text" name="goods[gnum]" class="form-control" value="{$goods['gnum']}" />
						<span class="input-group-addon">件</span>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">销量</label>
				<div class="col-md-6">
				<div class="input-group">
					<input type="text" name="goods[salenum]" class="form-control" value="{$goods['salenum']}" />
					<span class="input-group-addon">件</span>
				</div>
				</div>
			</div>


			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label"><span style='color:red'>*</span>价格</label>
				<div class="col-md-6">
				<div class="input-group">
					<input type="text" name="goods[oprice]" class="form-control" value="{$goods['oprice']}" />
					<span class="input-group-addon">元</span>
				</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">市场价</label>
				<div class="col-md-6">
				<div class="input-group">
					<input type="text" name="goods[mprice]" class="form-control" value="{$goods['mprice']}" />
					<span class="input-group-addon">元</span>
				</div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">项目所需时长</label>
				<div class="col-md-6">
					<div class="input-group">
						<input type="number" name="endtime" class="form-control" value="{$goods['endtime']}" />
						<span class="input-group-addon">分钟</span>
					</div>
				</div>
			</div>
			<div class="form-group" style="display: none">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">组团人数不足提醒(整数分钟)</label>
				<div class="col-md-6">
					<div class="input-group">
						<input type="text" name="goods[no_num_success]" class="form-control" value="{$goods['no_num_success']}" />
						<span class="input-group-addon">分钟</span>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label"><span style='color:red'>*</span>首页图片</label>
				<div class="col-md-6">
					{php echo tpl_form_field_image('goods[gimg]', $goods['gimg']);}
					<span class="help-block">图片建议为640X300</span>
				</div>
			</div>
		    <div class="form-group">
		        <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span>图集</label>
		        <div class="col-sm-6">
		           {php echo tpl_form_field_multi_image('img',$piclist);}
		            <span class="help-block">商品详情幻灯片，建议640X350</span>
		        </div>
		    </div>
			 <div class="form-group">
		                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style='color:red'>*</span> 订单通知接收员</label>
		                    <div class="col-sm-9 col-xs-12">
		                        <input type='hidden' id='openid' name='openid' value="{$saler['openid']}" />
		                        <div class='input-group'>
		                            <input type="text" name="saler" maxlength="30" value="{if !empty($saler)}{$saler['nickname']}{/if}" id="saler" class="form-control" readonly />
		                            <div class='input-group-btn'>
		                                <button class="btn btn-default" type="button" onclick="popwin = $('#modal-module-menus2').modal();">选择订单通知接收员</button>
		                            </div>
		                        </div>
		                        {if !empty($saler)}
		                        <span class='help-block'><img style="width:100px;height:100px;border:1px solid #ccc;padding:1px" src="{$saler['avatar']}" id="avatar" /></span>
		                        {/if}
		                        <div id="modal-module-menus2"  class="modal fade" tabindex="-1">
		                            <div class="modal-dialog" style='width: 660px;'>
		                                <div class="modal-content">
		                                    <div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="saler_close" type="button">×</button><h3>选择订单通知接收员</h3></div>
		                                    <div class="modal-body" >
		                                        <div class="row">
		                                            <div class="input-group">
		                                                <input type="text" class="form-control" name="keyword" value="" id="search-kwd2" placeholder="请输入管理员昵称" />
		                                                <span class='input-group-btn'><button type="button" class="btn btn-default" onclick="search_members2();">搜索</button></span>
		                                            </div>
		                                        </div>
		                                        <div id="module-menus2" style="padding-top:5px;"></div>
		                                    </div>
		                                    <div class="modal-footer"><a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a></div>
		                                </div>
		                            </div>
		                        </div>
		                    </div>
		                </div>
		</div>
	</div>
</div>
<div class="panel panel-default">
	<div class="panel-heading">控制开关</div>
	<div class="panel-body">
		<div class="panel-body">
		
			<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">首页显示</label>
					<div class="col-xs-12 col-sm-8">
						<div class="input-group">
<label class="radio radio-inline">
							<input type="radio" name="goods[showindex]" value="0" {if intval($goods['showindex']) ==0}checked="checked"{/if}> 开
						</label>						
						<label class="radio radio-inline">
							<input type="radio" name="goods[showindex]" value="1" {if intval($goods['showindex']) ==1 }checked="checked"{/if}> 关
						</label>
						
						</div>
					</div>
				</div>

			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">是否多次活动</label>
				<div class="col-xs-12 col-sm-8">
					<div class="input-group">
						<label class="radio radio-inline">
							<input type="radio" name="many" value="1" {if intval($goods['active_times']) > 1}checked="checked"{/if} onclick="$('#spike').show();">是
						</label>
						<label class="radio radio-inline">
							<input type="radio" name="many" value="0" {if intval($goods['active_times']) == 1 || empty($goods['active_times'])}checked="checked"{/if} onclick="$('#spike').hide();">否
						</label>
					</div>
				</div>
			</div>

			<div class="form-group">
				<div id="spike" {if $goods['active_times'] == 1 || empty($goods['active_times'])}style="display: none;"{/if}>
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">共有</label>
					<div class="col-xs-12 col-sm-6">
						<div class="input-group">
							<input type="text" name="goods[active_times]" class="form-control" value="{if empty($goods['active_times'])}1{else}{$goods['active_times']}{/if}" />
							<span class="input-group-addon">次</span>
						</div>
					</div>
				</div>
			</div>

				<div class="form-group" style="display: none">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">上架通知</label>
					<div class="col-xs-12 col-sm-8">
						<div class="input-group">					
						<label class="radio radio-inline">
							<input type="radio" name="goods[isupjia]" value="1" {if intval($goods['isupjia']) ==1 }checked="checked"{/if}> 开
						</label>
						<label class="radio radio-inline">
							<input type="radio" name="goods[isupjia]" value="0" {if intval($goods['isupjia']) ==0}checked="checked"{/if}> 关
						</label>
						</div>
					</div>
				</div>
				<div class="form-group" style="display: none">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">降价通知</label>
					<div class="col-xs-12 col-sm-8">
						<div class="input-group">					
						<label class="radio radio-inline">
							<input type="radio" name="goods[isdownjia]" value="1" {if intval($goods['isdownjia']) ==1 }checked="checked"{/if}> 开
						</label>
						<label class="radio radio-inline">
							<input type="radio" name="goods[isdownjia]" value="0" {if intval($goods['isdownjia']) ==0}checked="checked"{/if}> 关
						</label>
						</div>
					</div>
				</div>



				<div class="form-group type" style="display:none;">
    <label class="col-xs-12 col-sm-3 col-md-2 control-label">商品属性</label>
    <div class="col-sm-9 col-xs-12" >
        <label  class="radio radio-inline" onclick="$('.chageprice').hide();$('.limittime').hide();" style="display:none;">
            <input type="radio" name="goods[type]" value="1" id="type" {if $goods['type'] == 1}checked="true"{/if} > 新用户专享</input>
        </label>
        <label  class="radio radio-inline" onclick="$('.chageprice').hide();$('.limittime').show();" style="display:none;">
            <input type="radio" name="goods[type]" value="4" id="type" {if $goods['type'] == 4}checked="true"{/if} > 限时卖</input>
        </label>
		<label  class="radio radio-inline" >
            <input type="radio" name="goods[type]" value="5" id="type" {if $goods['type'] == 5||intval($goods['type'])==0}checked="true"{/if} > 正常</input>
        </label>
    </div>
</div>


				{if $isjudgment['status']}
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">活动评价</label>
					<div class="col-xs-12 col-sm-8">
						<div class="input-group">
						<label class="radio radio-inline">
							<input type="radio" name="goods[isjudgment]" value="1" {if intval($goods['isjudgment']) ==1 }checked="checked"{/if}> 开
						</label>	
					<label class="radio radio-inline">
							<input type="radio" name="goods[isjudgment]" value="0" {if intval($goods['isjudgment']) ==0}checked="checked"{/if}> 关
						</label>
						
						</div>
					</div>
				</div>
				{/if}


				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">显示详情</label>
					<div class="col-xs-12 col-sm-8">
						<div class="input-group">
						<!--默认0显示1不显示-->	
						<label class="radio radio-inline">
							<input type="radio" name="goods[issharedesc]" value="0" {if intval($goods['issharedesc']) ==0}checked="checked"{/if}>开
						</label>
						<label class="radio radio-inline">
							<input type="radio" name="goods[issharedesc]" value="1" {if intval($goods['issharedesc']) ==1 }checked="checked"{/if}> 关
						</label>
					
						
						</div>
					</div>
				</div>

				<div class="form-group" sty>
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">显示购买记录</label>
					<div class="col-xs-12 col-sm-8">
						<div class="input-group">
							<label class="radio radio-inline">
								<input type="radio" name="goods[isshowsend]" value="1" {if intval($goods['isshowsend']) ==1}checked="checked"{/if}> 开
							</label>

							<label class="radio radio-inline">
								<input type="radio" name="goods[isshowsend]" value="0" {if intval($goods['isshowsend']) ==0 }checked="checked"{/if}> 关
							</label>
						</div>
					</div>
				</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">状态</label>
				<div class="col-md-6">
					<label class="radio radio-inline">
						<input type="radio" name="goods[isshow]" value="1" {if intval($goods['isshow']) ==1 || empty($goods['isshow'])}checked="checked"{/if}> 上架
					</label>
					<label class="radio radio-inline">
						<input type="radio" name="goods[isshow]" value="2" {if intval($goods['isshow']) ==2}checked="checked"{/if}> 下架
					</label>
					<label class="radio radio-inline">
						<input type="radio" name="goods[isshow]" value="3" {if intval($goods['isshow']) ==3}checked="checked"{/if}> 售罄
					</label>
				</div>
			</div>
			{if !empty($id)}
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">添加日期</label>
				<div class="col-md-6">
					<p class="form-control-static">{php echo date('Y-m-d H:i', $goods['createtime']);}</p>
				</div>
			</div>
			{/if}
		</div>
	</div>
</div>
<style>
button.saler_close {
    -webkit-appearance: none;
    padding: 0;
    cursor: pointer;
    background: 0 0;
    border: 0;
}

.saler_close {
    float: right;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    filter: alpha(opacity=20);
    opacity: .2;
}
</style>
<script language='javascript'>
	
	    function search_members2() {
           	if( $.trim($('#search-kwd2').val())==''){
                Tip.focus('#search-kwd2','请输入关键词');
                return;
            }

			$("#module-menus2").html("正在搜索....")
			$.get('{php echo web_url('store/bdelete/display',array('op'=>'selectsaler'))}', {
				keyword: $.trim($('#search-kwd2').val())
			}, function(dat){
				$('#module-menus2').html(dat);
			})
		}
		function search_members() {
			if( $.trim($('#search-kwd').val())==''){
				Tip.focus('#search-kwd','请输入关键词');
				return;
			}

			$("#module-menus").html("正在搜索....")
			$.get('{php echo web_url('store/bdelete/display',array('op'=>'selectsaler'))}', {
				keyword: $.trim($('#search-kwd').val())
			}, function(dat){
				$('#module-menus').html(dat);
			});
		}
		function select_member(o) {
			$("#openid").val(o.openid);
			$("#saler").val(o.nickname);
			$("#avatar").attr('src', o.avatar);
			$(".saler_close").click();
		}
	    
	</script>